Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove mysql-connector dependency #1200

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

maximemulder
Copy link
Contributor

@maximemulder maximemulder commented Oct 10, 2024

While testing #1150, @cmadjar encountered an issue when connecting to the database through SQLAlchemy. I suspect this is because this connection is using a deprecated version of mysql-connector. This dependency was already present in LORIS-MRI before adding SQLAlchemy although it was unused, and I wrongfully used it for the SQLAlchemy connection not knowing the version we had was deprecated (the non-depecrated version is mysql-connector-python.).

Solution: Remove the mysql-connector dependency and use mysqlclient instead, which is the client we use for the non-SQLAlchemy database connection.

P.S. 1: I manually recreated my virtual environment to make sure the dependency was completely removed, but it was detected by git, so I added the directory the gitignore, I have no idea why it was ignored before.

P.S. 2 : Some whitespace auto-trimming, ignore whitespaces in review.

P.S. 3 : Added quote() to escape the username and password of the use (the database and host should not have special characters).

Notes for existing projects

  • Need to remove mysql-connector via pip uninstall mysql-connector

@maximemulder maximemulder added Bug A-ORM Area: ORM. Issues and pull requests related to the SQLAlchemy integration labels Oct 10, 2024
@maximemulder maximemulder force-pushed the 2024-10-09_remove-mysqlconnector branch 2 times, most recently from adbb289 to f37b689 Compare October 10, 2024 17:20
@maximemulder maximemulder force-pushed the 2024-10-09_remove-mysqlconnector branch from 942be59 to e238b40 Compare October 10, 2024 18:59
Copy link
Collaborator

@cmadjar cmadjar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works with the quote() 👍

@cmadjar cmadjar merged commit 27f6ba9 into aces:main Oct 10, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ORM Area: ORM. Issues and pull requests related to the SQLAlchemy integration Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants